
#ifndef PROJECTZ_NUSER_NCOMMAND_CS_RELEASE_QUICK_SLOT_H_
#define PROJECTZ_NUSER_NCOMMAND_CS_RELEASE_QUICK_SLOT_H_

#include "../../engine.h"

#include "../../User.h"

namespace ProjectZ { namespace NCommand { namespace NWorld {

class CS_RELEASE_QUICK_SLOT
{
public:
	static void OnExecute(User * pUser, ::Network::Packet * pPacket)
	{
		PREPARE_PACKET;

		int quickslot_idx = 0;
		pPacket->ParseMsg("%c", &quickslot_idx);

		if (0 > quickslot_idx || quickslot_idx > 7)
		{
			::Network::Packet * pAck = ::Network::GETPACKETPOOL()->SEND_NEW();
			pAck->MsgCat("%2d%c", ACK_UNKNOWN_ERROR, quickslot_idx);
			pAck->MakePacket(CMD_SC_RELEASE_QUICK_SLOT);
			pUser->Send(pAck);
			return;
		}

		pUser->GetCharacterInfo().array_QuickSlot[quickslot_idx].type = 0;
		pUser->GetCharacterInfo().array_QuickSlot[quickslot_idx].index = 0;

		::Network::Packet * pAck = ::Network::GETPACKETPOOL()->SEND_NEW();
		pAck->MsgCat("%2d%c", ACK_OK, quickslot_idx);
		pAck->MakePacket(CMD_SC_RELEASE_QUICK_SLOT);
		pUser->Send(pAck);
	}
};

} /*NWorld*/ } /*NCommand*/ } /*ProjectZ*/


#endif /* PROJECTZ_NUSER_NCOMMAND_CS_RELEASE_QUICK_SLOT_H_ */
